<extend name="./Application/Admin/View/Public/base.html" />
<block name="eosi-css">
    <link href="__PUBLIC__/assets/css/daterangepicker.css" rel="stylesheet">
</block>

<block name="eosi-js"> 
    <script src="__PUBLIC__/assets/js/date-time/bootstrap-datepicker.min.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/jquery.jqGrid.min.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/i18n/jquery.min.js"></script>

    <script src="__PUBLIC__/assets/js/jqGrid/i18n/super_slider.js"></script>
    <script src="__PUBLIC__/assets/js/jqGrid/i18n/grid.locale-en.js"></script>
    <script src="__PUBLIC__/js/ajaxfileupload.js"></script>
    <script type="text/javascript">
                var $path_base = "/"; 
    </script>

</block>
<block name="page-content">

        
    <div  class=""  style="height: 40px;">
        <span class="input-icon"> 
            <input type="text" placeholder="输入图片名模糊查找"   value="{$ori_name}"
            class="nav-search-input" id="ori_name" autocomplete="off" style="width:250px;" /> 
        </span>
        <span class="input-icon"> 
            <select  id="type"> 
                <option value="">选择图片用途</option>
                <option value="1">商品图</option>
                <option value="2">造型图</option>
                
            </select>
            <!-- <span>{$bname_id}</span> -->
            <!-- <i class="icon-search nav-search-icon"></i> -->
        </span>

        <span class="input-icon"> 
            <select  id="is_using"> 
                <option value="">选择图片使用情况</option>
                <option value="1">已使用</option>
                <option value="0">从未使用</option>
                
            </select>
            <!-- <span>{$bname_id}</span> -->
            <!-- <i class="icon-search nav-search-icon"></i> -->
        </span>
        
        <input type="button" id="search" value="查询"/>
        <input type="button" id="resetBt" value="重置筛选条件" />
         
    </div>
    <div class="row">
        <div class="col-xs-12">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>                    
                        <th>编号</th>
                        <!-- <th>所属类型</th> -->
                        <th>图片名</th>
                        <th>图片</th>
                        <th>图片用途</th>
                        <th>使用情况</th>
                        <th>创建时间/更新时间</th>
                        
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <volist name="_list" id="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <!-- <td>{$vo.cate}</td> -->
                            <td>{$vo.ori_name}</td>                  
                            <td>
                                <img src="{$vo.uni_img}" style='height:100px'>       
                            </td>
                            <td>
                                <!-- {$vo.typeText} -->
                                <eq name="vo.type" value="1">
                                    <!-- <a href="javascript:void(0);" title="商品图"> -->
                                        <i class="icon-hdd"></i>&nbsp;&nbsp;商品
                                    <!-- </a> -->
                                <else/>
                                    <!-- <a href="javascript:void(0);" title="造型图"> -->
                                        <i class="icon-user-md"></i>&nbsp;&nbsp;造型
                                    <!-- </a> -->
                                </eq>
                                
                            </td>
                            <td>
                                <!-- {$vo.typeText} -->
                                <eq name="vo.is_using" value="1">
                                    <!-- <a href="javascript:void(0);" title="商品图"> -->
                                        <span>已使用</span>
                                    <!-- </a> -->
                                <else/>
                                    <!-- <a href="javascript:void(0);" title="造型图"> -->
                                        <span style="color:red;">从未使用</span>
                                    <!-- </a> -->
                                </eq>
                                
                            </td>
                            <td>{$vo.create_time}<br/>{$vo.update_time}</td>
                            
                            <td>
                                <!-- <span class=" icon-pencil blue" title="编辑" style="cursor: pointer;" onclick="editRule({$vo.id});"></span>
                                &nbsp;&nbsp; -->
                                <span class=" icon-trash red" title="删除" style="cursor: pointer;" onclick="delRule({$vo.id});"></span>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
            <div class="pager">{$_page}</div>
        </div>
    </div><!-- /.row -->

    <script type="text/javascript">
        $('#type').val("{$type}");
        $('#is_using').val("{$is_using}");
          //删除任务
        function delRule(ruleid){
            art.dialog.confirm('确定删除这张图片吗?', function () {
                $.ajax({
                    type: "POST",
                    url: "__CONTROLLER__/deleteRule",
                    dataType: 'json',
                    data: {id:ruleid},
                    async: false,
                    error:function(){
                        art.dialog.alert("网络原因操作失败,请稍后再试.");
                    },
                    success: function(data){
                        if (data.status == 1) {
                            art.dialog.alert('删除成功');
                            location.href = location.href; //刷新
                        } else {
                            art.dialog.alert(data.info);
                        }
                    }
                });
            });
        }
         $("#search").click(function(){
            var ori_name=$('#ori_name').val();
            var type=$("#type option:selected").val();
            var is_using=$("#is_using option:selected").val();
            
            if(ori_name !=''){
                ori_name="/ori_name/"+ori_name;
            }
            if(type !=''){
                type="/type/"+type;
            }
            if(is_using !=''){
                is_using="/is_using/"+is_using;
            }
            location.href = "/Admin/MultiUploadPic/index"+ori_name+type+is_using;
        });
         $("#resetBt").click(function(){
            location.href = "/Admin/MultiUploadPic/index";
        });
     
    </script>

</block>